Optimal. Leaf size=55 \[ \frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \cos (c+d x)}{\sqrt{a+b}}\right )}{a d \sqrt{a+b}}-\frac{\tanh ^{-1}(\cos (c+d x))}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0638404, antiderivative size = 55, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3186, 391, 206, 208} \[ \frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \cos (c+d x)}{\sqrt{a+b}}\right )}{a d \sqrt{a+b}}-\frac{\tanh ^{-1}(\cos (c+d x))}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3186
Rule 391
Rule 206
Rule 208
Rubi steps
\begin{align*} \int \frac{\csc (c+d x)}{a+b \sin ^2(c+d x)} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{1}{\left (1-x^2\right ) \left (a+b-b x^2\right )} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{a d}+\frac{b \operatorname{Subst}\left (\int \frac{1}{a+b-b x^2} \, dx,x,\cos (c+d x)\right )}{a d}\\ &=-\frac{\tanh ^{-1}(\cos (c+d x))}{a d}+\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \cos (c+d x)}{\sqrt{a+b}}\right )}{a \sqrt{a+b} d}\\ \end{align*}
Mathematica [C] time = 0.308812, size = 143, normalized size = 2.6 \[ -\frac{\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b}-i \sqrt{a} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{-a-b}}\right )}{\sqrt{-a-b}}+\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b}+i \sqrt{a} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{-a-b}}\right )}{\sqrt{-a-b}}-\log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )+\log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.102, size = 67, normalized size = 1.2 \begin{align*}{\frac{\ln \left ( -1+\cos \left ( dx+c \right ) \right ) }{2\,da}}-{\frac{\ln \left ( 1+\cos \left ( dx+c \right ) \right ) }{2\,da}}+{\frac{b}{da}{\it Artanh} \left ({b\cos \left ( dx+c \right ){\frac{1}{\sqrt{ \left ( a+b \right ) b}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) b}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.90993, size = 440, normalized size = 8. \begin{align*} \left [\frac{\sqrt{\frac{b}{a + b}} \log \left (\frac{b \cos \left (d x + c\right )^{2} + 2 \,{\left (a + b\right )} \sqrt{\frac{b}{a + b}} \cos \left (d x + c\right ) + a + b}{b \cos \left (d x + c\right )^{2} - a - b}\right ) - \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) + \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right )}{2 \, a d}, -\frac{2 \, \sqrt{-\frac{b}{a + b}} \arctan \left (\sqrt{-\frac{b}{a + b}} \cos \left (d x + c\right )\right ) + \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) - \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right )}{2 \, a d}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.13179, size = 135, normalized size = 2.45 \begin{align*} -\frac{\frac{2 \, b \arctan \left (\frac{b \cos \left (d x + c\right ) + a + b}{\sqrt{-a b - b^{2}} \cos \left (d x + c\right ) + \sqrt{-a b - b^{2}}}\right )}{\sqrt{-a b - b^{2}} a} - \frac{\log \left (\frac{{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]